package com.ms.game.itembox.db;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import com.ms.game.itembox.AccountItemChangeWay;
import com.ms.game.itembox.ItemChangeWay;
import com.ms.player.PlayerUserType;
import com.xpec.c4.db.model.log.basic.BasicTransactionLogModel;

@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = AccountItemChangeLogModel.TABLE_NAME)
@org.hibernate.annotations.Table(
		appliesTo = AccountItemChangeLogModel.TABLE_NAME, indexes = {
				@org.hibernate.annotations.Index(name = "IDX_PURCHAS_ID", columnNames = { "purchaseId" }),
		})
public class AccountItemChangeLogModel extends BasicTransactionLogModel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 393855512433120030L;
	
	public static final String TABLE_NAME = "account_item_change";
	
	/** account guid */
	private String accountId;
	
	/** player guid */
	private String playerId;
	
	/** player name */
	private String playerName;
	
	/** 使用者類型 {@link PlayerUserType} */
	private int userType;
	
	/** 遊戲館id */
	private String gameHallId;

	/** 遊戲館名 */
	private String gameHallName;
	
	/** 道具序號 */
	private String itemSn;
	
	/** 道具id */
	private String itemId;
	
	/** 道具名 */
	private String itemName;
	
	/** 異動數量 */
	private long changeCount;
	
	/** 異動前數量 */
	private long beforeChange;

	/** 變更後數量 */
	private long afterChange;
	
	private String giftTitle;

	private String purchaseId;
	
	/**
	 * 平台帳號
	 */
	private String openId;

	/**
	 * 行為
	 */
	private int changeWay;
	
	/**
	 * 行為註釋 {@link ItemChangeWay}
	 */
	private AccountItemChangeWay changeWayDesc;

	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	public String getPlayerId() {
		return playerId;
	}

	public void setPlayerId(String playerId) {
		this.playerId = playerId;
	}

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

	public String getGameHallId() {
		return gameHallId;
	}

	public void setGameHallId(String gameHallId) {
		this.gameHallId = gameHallId;
	}

	public String getGameHallName() {
		return gameHallName;
	}

	public void setGameHallName(String gameHallName) {
		this.gameHallName = gameHallName;
	}

	public String getItemSn() {
		return itemSn;
	}

	public void setItemSn(String itemSn) {
		this.itemSn = itemSn;
	}

	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	public String getItemName() {
		return itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	public long getChangeCount() {
		return changeCount;
	}

	public void setChangeCount(long changeCount) {
		this.changeCount = changeCount;
	}

	public long getBeforeChange() {
		return beforeChange;
	}

	public void setBeforeChange(long beforeChange) {
		this.beforeChange = beforeChange;
	}

	public long getAfterChange() {
		return afterChange;
	}

	public void setAfterChange(long afterChange) {
		this.afterChange = afterChange;
	}

	@Enumerated(EnumType.STRING)
	public AccountItemChangeWay getChangeWayDesc() {
		return changeWayDesc;
	}

	public void setChangeWayDesc(AccountItemChangeWay changeWayDesc) {
		this.changeWayDesc = changeWayDesc;
	}
	
	public String getGiftTitle() {
		return giftTitle;
	}

	public void setGiftTitle(String giftTitle) {
		this.giftTitle = giftTitle;
	}

	public String getPurchaseId() {
		return purchaseId;
	}

	public void setPurchaseId(String purchaseId) {
		this.purchaseId = purchaseId;
	}

	public int getChangeWay() {
		return changeWay;
	}

	public void setChangeWay(int changeWay) {
		this.changeWay = changeWay;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}
}
